﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FactoryClsssLib.Strategy
{
    /// <summary>
    /// 1、配置文件
    /// 2、反射
    /// 3、字典
    /// </summary>
    public class StrategyFactory
    {
        public static IStrategy GetStrategy(string flag)
        {
            if (flag.Equals("大人"))
            {
                return new OperationDivision();
            }
            else if (flag.Equals("小孩"))
            {
                return new OperationMultiply();
            }
            else if (flag.Equals("女孩"))
            {
                return new OperationSubtract();
            }
            else if (flag.Equals("老人"))
            {
                /*int sum = sum1 / sum2;// 具体函数 DoOperation
                return sum;*/
                return new OperationMultiply();
            }
            else if (flag.Equals("邻居"))
            {
                /*int sum = sum1 / sum2;// 具体函数 DoOperation
                return sum;*/
                return new OperationY();
            }
            else if (flag.Equals("小偷"))
            {
                /*int sum = sum1 / sum2;// 具体函数 DoOperation
                return sum;*/
                return new OperationH();
            }
            return null;
        }
    }
}
